﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="QLTinTuc.aspx.cs" Inherits="Admin_TinTuc_QLTinTuc" %>

<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HomePlaceHolder" Runat="Server">
    <script type="text/javascript">
        var gridMain = null;
        window.onload = function () {
            try {
                //get target base control.
                gridMain = document.getElementById('<%= this.gridCatalog.ClientID %>');
            }
            catch (err) {
                gridMain = null;
            }
        }
    </script>
    <script src="../../Scripts/QLTinTuc.js" type="text/javascript"></script>
    <div class="hrm_header_placeholder">
        Quản lý Tin tức</div>
            <div style="padding: 10px; height: 500px; overflow: scroll">
                <asp:Panel ID="PanelAdd" Width="100%" GroupingText="Tìm kiếm thông tin" runat="server">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="5" height="10">
                        </td>
                    </tr>
                    <tr>
                        <td width="20">
                        </td>
                        <td width="70" class="hrm_title_blue">
                            Tiêu đề
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td>
                            <asp:TextBox ID="txtTieuDe" CssClass="hrm_textbox" Width="200px" MaxLength="100"
                                runat="server"></asp:TextBox>
                        </td>
                        <td width="20">
                        </td>
                        <td width="70" class="hrm_title_blue">
                            Nội dung
                        </td>
                        <td width="7" class="hrm_title_blue">
                            :
                        </td>
                        <td>
                            <asp:TextBox ID="txtNoiDung" CssClass="hrm_textbox" Width="200px" MaxLength="100"
                                runat="server"></asp:TextBox>
                        </td>
                        <td width="20">
                        </td>
                        <td>
                            <asp:ImageButton ID="cmdTimKiem" ImageUrl="~/Images/tim.jpg" runat="server" OnClick="cmdTimKiem_Click" />
                            <asp:ImageButton ID="cmdTimLai" CausesValidation="false" ImageUrl="~/Images/timlai.jpg"
                                runat="server" OnClick="cmdTimLai_Click" />
                        </td>
                    </tr>
                </table>
                </asp:Panel>
                <asp:Panel ID="PanelList" Width="100%" GroupingText="Danh sách" Height="435" runat="server">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="20">
                            </td>
                            <td style="padding-right: 15px; padding-top: 12px">
                                <asp:GridView ID="gridCatalog" runat="server" DataKeyNames="Id" Width="100%" BackColor="White"
                                    OnRowDataBound="gridCatalog_RowDataBound" EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                                    BorderColor="#CCCCCC" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="1px"
                                    CellPadding="3" EnableModelValidation="True">
                                    <Columns>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="STT" ItemStyle-Width="30">
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="30px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="30" HeaderText="Chọn">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkSelect" runat="server" />
                                                <asp:HiddenField ID="H_IdCatalog" runat="server" Value='<%# Eval("Id") %>' />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="30px" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="TieuDe" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
                                            HeaderText="Tiêu đề">
                                            <ItemStyle Width="30%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="TomTat" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
                                            HeaderText="Tóm tắt">
                                            <ItemStyle Width="40%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LuotXem" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="10%" HeaderText="Lượt xem">
                                            <ItemStyle Width="8%" />
                                        </asp:BoundField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="Ngày cập nhật" ItemStyle-Width="90">
                                            <ItemTemplate>
                                                <asp:Label ID="LabelNgayCapNhat" runat="server" Text='<%# Convert.ToDateTime(Eval("NgayCapNhat")).ToString("dd/MM/yyyy")%>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="12%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="Đã đăng" ItemStyle-Width="8%">
                                            <ItemTemplate>
                                                <asp:Label ID="LabelTinNong" runat="server" Text='<%# (Eval("TrangThai").ToString())=="True" ? "<html><img src=../../Images/checkk.png /></html>" : "<html><img src=../../Images/redx.png /></html>"%>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="8%" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <RowStyle ForeColor="#000066" />
                                    <SelectedRowStyle BackColor="#dedfdf" Font-Bold="True" ForeColor="Gray" />
                                    <HeaderStyle BackColor="#006699" Font-Bold="True" HorizontalAlign="Left" ForeColor="White" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" height="10">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <cc1:Pager ID="Pager1" runat="server" PreviousClause="Lùi" NextClause="Tiến" LastClause=""
                                    FirstClause="" PageClause="Trang " OfClause=" /" PageSize="10" OnCommand="Pager1_Command"
                                    ForeColor="#006600" Font-Bold="True" />
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
            <asp:Panel ID="Panel2" CssClass="div_footer" BackColor="#d6e6f5" runat="server" Height="24px">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                            <asp:ImageButton ID="cmdTaoMoi" CausesValidation="false" ImageUrl="~/Images/taomoi.jpg"
                                PostBackUrl="~/Admin/TinTuc/CNTinTuc.aspx" runat="server" />
                            <asp:ImageButton ID="cmdHieuChinh" CausesValidation="false" OnClientClick="return HieuChinh_TinTuc();"
                                ImageUrl="~/Images/hieuchinh.jpg" runat="server" OnClick="cmdHieuChinh_Click" />
                            <asp:ImageButton ID="cmdXoa" CausesValidation="false" OnClientClick="return Xoa_TinTuc();"
                                ImageUrl="~/Images/xoa.jpg" runat="server" OnClick="cmdXoa_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
</asp:Content>

